-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pre-commit hooks and fixes #1934
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about some of these docstring changes, that may or may not have been working before.
I agree, there are some things that could be tidied up a bit still. I think before I fix up these little ones we should decide if the auto-formatting is something we want more generically or not? After this PR I also tested out black, which surprisingly wasn't as bad as I expected it to be... main...greglucas:black |
If it helps, several other SciTools projects have adopted |
@greglucas As a workflow, I'd prefer to see IMHO this is a light-weight way to enforce compliance and ensure code quality across the repo. |
@greglucas Could you also adopt the use of .git-blame-ignore-revs in this PR, so that you are not blamed for other authors contributions due to your You can also decorate the commit sha with a comment to record some provenance to what the commit sha is, what PR it's associated with and the change that was introcuded e.g., something along the lines of...
(I've used a bogus sha here) I think this would be super useful 👍 |
@greglucas Are you happy for me to enable |
Applying code linters for whitespace fixes. Applying docstring linter. Module level docstring should be first. Change all others to normal commments.
I would be in favor of using |
Well, I'm happy to merge this PR now and enable I guess that might force other PR authors to rebase once this PR lands on Thoughts? Are you happy for me to bank this and see how we roll? |
Note to self: use a |
We have a lot of PRs that have been sitting for several years now, so I'm guessing rebasing is expected at this point 😄 I'm fine with rolling with it and making updates incrementally as we go if this does cause any issues. |
@greglucas Tis a beautiful thing... |
@greglucas I'll push a PR to add the |
Added a pre-commit configuration file and applied the auto-linters to the codebase fixing up whitespace and docstrings. Not sure if we want to enable https://pre-commit.ci/ or not?